Skip to content

feat(autofix): Fix additional deprecated Core APIs #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Jun 5, 2025

Conversation

maxreichmann
Copy link
Member

@maxreichmann maxreichmann commented Apr 24, 2025

JIRA: CPOUI5FOUNDATION-991

Enhances #671 by enabling more complex autofixes where migration depends on the provided arguments.

Resolves partially: #619

Follow up PRs:
#675

@maxreichmann maxreichmann force-pushed the autofix-deprecated-core-apis branch 4 times, most recently from 7c8c5bc to bb20759 Compare April 29, 2025 09:34
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch 2 times, most recently from fc44eab to 5fa49bb Compare May 15, 2025 08:06
@d3xter666 d3xter666 marked this pull request as ready for review May 27, 2025 08:48
@d3xter666 d3xter666 requested a review from a team May 27, 2025 08:48
"use strict";

sap.ui.getCore().getLibraryResourceBundle("library.with.custom.paths", "en_US");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently not fixed, but it should be, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be resolved with: #675

}

return fixHints;
}

function extractKeyValuePairs(jsonLikeStr: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have the relevant information accessible via AST nodes, so I don't think we should parse the argument ourselves here. The input is based on node.getText(). We even have already code that can analyze object structures, which is used for certain checks in SourceFileLinter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be resolved in #675

name: fixHints.exportCodeToBeUsed.args[0].value.replace(/^['"]+|['"]+$/g, ""),
url: libOptionsExpression.url,
};
fixHints.exportCodeToBeUsed.args[0].value = JSON.stringify(newArg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the comments in the code get lost. Also, the used quotes in the code will be always replaced by double-quotes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be resolved in #675

extractKeyValuePairs(fixHints.exportCodeToBeUsed.args[1].value) as {async: boolean; url?: string};
if (libOptionsExpression.async === true) {
const newArg = {
name: fixHints.exportCodeToBeUsed.args[0].value.replace(/^['"]+|['"]+$/g, ""),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using back-ticks as first arg (library name) results into quoted backticks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be resolved in #675

@d3xter666 d3xter666 changed the base branch from main to autofix-deprecated-core-base May 27, 2025 12:57
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from 43442c9 to 756264a Compare May 27, 2025 13:07
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-base branch from d0120ff to b272a5a Compare May 27, 2025 14:12
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from 756264a to cbc6e6a Compare May 27, 2025 14:23
@d3xter666 d3xter666 marked this pull request as draft May 28, 2025 07:00
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch 2 times, most recently from 0c07e32 to cb85a25 Compare May 28, 2025 07:46
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-base branch from 8372914 to 79ea741 Compare May 28, 2025 11:07
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch 3 times, most recently from f033503 to 0b46e18 Compare May 29, 2025 07:12
@d3xter666 d3xter666 marked this pull request as ready for review May 29, 2025 08:25
@d3xter666 d3xter666 requested a review from a team May 30, 2025 06:34
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from c815258 to 1eafe45 Compare June 2, 2025 11:22
@d3xter666 d3xter666 changed the title feat: Offer autofix for deprecated Core APIs feat(autofix): Fix deprecated Core APIs Jun 2, 2025
@d3xter666 d3xter666 requested review from RandomByte and matz3 June 2, 2025 13:27
Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@d3xter666 d3xter666 dismissed RandomByte’s stale review June 4, 2025 06:51

Issues were addressed

@RandomByte RandomByte changed the title feat(autofix): Fix deprecated Core APIs feat(autofix): Fix additional deprecated Core APIs Jun 5, 2025
Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@d3xter666 d3xter666 merged commit af2cb9b into main Jun 5, 2025
22 checks passed
@d3xter666 d3xter666 deleted the autofix-deprecated-core-apis branch June 5, 2025 12:08
@openui5bot openui5bot mentioned this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants